package com.shop.common.enums.user;

import lombok.Getter;

/**
 * 用户等级
 */
@Getter
public enum UserLevelEnum {

    FANS(0, "普通用户","普通用户",0),
    CHIEF(1, "团长","分享粉丝5人",5),
    L1(2,"L1","分享团长5人",5),
    L2(3, "L2","分享团长25人",25),
    L3(4, "L3","分享团长50人",50),
    L4(5, "L4","分享团长100人",100),
    L5(6, "L5","分享团长250人",250),
    L6(7, "L6","分享团长500人",500),
    CEO(8, "市场总裁","分享团长1000人",1000),
    ;

    private int key;
    private String name;
    private String condition;
    private int num;

    UserLevelEnum(int key, String name,String condition,int num) {
        this.key = key;
        this.name = name;
        this.condition = condition;
        this.num = num;
    }

    public static UserLevelEnum val(int key) {
        for (UserLevelEnum enumObj : UserLevelEnum.values()) {
            if(enumObj.key == key) {
                return enumObj;
            }
        }
        return null;
    }
}
